<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../style/gg.css" rel="stylesheet" type="text/css" />
<script>
        function del(){
        if(confirm("确认要删除吗？")){
        return true;
        }
        else{
        return false;
        }
        }
       
        function dj(){
        if(confirm("确认要冻结或者解冻吗？")){
        return true;
        }
        else{
        return false;
        }
        }
        </script>
</head>

<body>
<?php
session_start();
if($_SESSION['admin']!=""){
	
	?>
<?php
include("top.php");
include("../conn/conn.php");
?>
<table width="886" height="466" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150" align="center" valign="top">
	<?php
    	include("left.php");
	?></td>
    <td width="748" align="center" valign="top">
    <?php
    $sql="select * from tb_manager";
	$result=mysqli_query($link,$sql);
	if(mysqli_num_rows($result)>0){
		?>
        <a href=#" onclick="javascript:Wopen=open('admin_add.php','添加管理员','height=600,width=750,scrollbars=no');">添加管理员</a>
<table width="98%" align="center" class="bk" >
		<tr>
        <td height="50" align="center" valign="middle" bgcolor="#CCCCCC">账号</td><td align="center" valign="middle" bgcolor="#CCCCCC">姓名</td><td align="center" valign="middle" bgcolor="#CCCCCC">类型</td><td align="center" valign="middle" bgcolor="#CCCCCC">状态</td><td align="center" valign="middle" bgcolor="#CCCCCC">删除</td>
        </tr>
		<?php
      while($rows_m=mysqli_fetch_assoc($result)){
			?>
            <tr>
        <td height="40" align="center"><?=$rows_m['name']?></td><td align="center"><?=$rows_m['name']?></td><td align="center"><?=$rows_m['type']?></td>
        <td align="center">
		<?php
        if ($rows_m['whether']=="1"){
			?>
             <a href="admin_update.php?id=<?=$rows_m[id]?>" onClick="return dj();">冻结</a>
             <?php
			}
		else{
			?>
			 <a href="admin_update.php?id=<?=$rows_m[id]?>" onClick="return dj();">解冻</a>
             <?php
			}
		
		?>       
        
        </td>
        <td align="center">
        
    <a href="admin_del.php?id=<?=$rows_m[id]?>" onClick="return del();">删除</a> </td>
        </tr>
			<?php
            }
			?>
      </table>
	<?php
    }
	else{
				echo ("<script>alert '没有管理员';location='index.php';</script>");
				}
	
	?>
    
    </td>
  </tr>
</table>
	
	
	
	
	<?php
	}
	else{
		echo "<script>alert('请登陆再管理');location='index.php';</script>";
		
		}
?>
<table width="886" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="147">&nbsp;</td>
        <td width="739">
        <?php
        include("bottom.php")
		?></td>
      </tr>
</body>
</html>